﻿/*
 *  This file is part of SXAPI.
 *
 *  SXAPI is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU Lesser General Public License as published by
 *  the Free Software Foundation, version 3 of the License.

 *  SXAPI is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Lesser General Public License for more details.
 *  
 *  You should have received a copy of the GNU Lesser General Public License
 *  along with SXAPI.  If not, see <http://www.gnu.org/licenses/>.
 */

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace StackExchangeApi
{
    /// <summary>
    /// Represents a Comment on one of the "Trilogy Sites"
    /// </summary>
    public sealed class Comment : Post
    {
        /// <summary>
        /// Comments do not have Ids.
        /// 
        /// It is expected that this will change in the future.
        /// 
        /// For the time being, accessing this property
        /// causes a NotImplementedException to be thrown.
        /// </summary>
        public new long Id
        {
            get
            {
                throw new NotImplementedException("Comments do not have Ids at this point in time");
            }
        }

        /// <summary>
        /// Post this Comment was on.
        /// Either a Question or an Answer
        /// </summary>
        public Post On { get; internal set; }

        /// <summary>
        /// When this Comment was published
        /// </summary>
        public DateTime Published { get; internal set; }

        /// <summary>
        /// When this Comment was last updated.
        /// </summary>
        public DateTime Updated { get; internal set; }

        /// <summary>
        /// Construct a new Comment
        /// </summary>
        /// <param name="title">Title of the Comment, generally the title of the Question or Answer it is on</param>
        /// <param name="author">Name of the author of the Comment</param>
        /// <param name="on">Post the Comment is on</param>
        /// <param name="published">date published</param>
        /// <param name="updated">date last updated</param>
        /// <param name="summary">HTML encoded summary of the Comment</param>
        /// <param name="site">Site the Comment is on</param>
        internal Comment(String title, String author, Post on, DateTime published, DateTime updated, String summary, StackExchangeSite site) :
            base(title, -1, -1, site)
        {
            Author = author;
            On = on;
            Published = published;
            Updated = updated;
            Summary = summary;
        }
    }
}
